<template>
    <div>
        child---{{ props.title }}---{{ props.obj.age }}
        <button @click="handleClick">子传父</button>
    </div>
</template>
<script setup lang="ts">

interface IProps {
    name: string,
    age: number
}

const props = defineProps<{
    title: string,
    obj: IProps
}>()

// const emit = defineEmits(["event"]) //未用ts
const emit = defineEmits<{
    (e: 'event', myvalue: string): void
}>()
const handleClick = () => {
    emit("event", "hello parent")
}

</script>